Python

ProgrammingError at /admin/ Table 'django_session' doesn't exist python

ProgrammingError at /admin/ Table 'django_session' doesn't exist python, someone asked me to explain?

I got this following error while running django project "ProgrammingError at /admin/ Table 'django_session' doesn't exist".

ProgramminError

SOLUTION:

This error you will get, when you're not migrated the django model.

CODE:

import datetime
from django.db import models
import os
from django.db import models

def getFileName(request,filename):
    now_time=datetime.datetime.now().strftime("%Y%m%d%H:%M:%S")
    new_filename="%s%s"%(now_time,filename)
    return os.path.join('uploads/', new_filename)

class Category(models.Model):
    name=models.CharField(max_length=150,null=False,blank=False)
    image=models.ImageField(upload_to=getFileName,null=True,blank=True)
    description=models.TextField(max_length=500,null=False,blank=False)
    status=models.BooleanField(default=False,help_text="0-Show,1-Hidden")
    created_at=models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.name
python manage.py makemigrations
python manage.py migrate
After completing migrations create super user
python manage.py createsuperuser


SOLUTION:

pip install matplotlib

VIDEO GUIDE:

Post your comments / questions